package com.unknown.wiki.domain;

import java.util.Date;
import java.util.Objects;

/**
 * Description: Github project domain
 *
 * @author ankh
 * @since 31.01.2019
 */
public class ProjectDomain {

    private int id;
    private String projectOwner;
    private String projectName;
    private boolean hasWiki;
    private Date createTime;
    private Date updateTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getProjectOwner() {
        return projectOwner;
    }

    public void setProjectOwner(String projectOwner) {
        this.projectOwner = projectOwner;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public boolean isHasWiki() {
        return hasWiki;
    }

    public void setHasWiki(boolean hasWiki) {
        this.hasWiki = hasWiki;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ProjectDomain that = (ProjectDomain) o;
        return id == that.id &&
                hasWiki == that.hasWiki &&
                Objects.equals(projectOwner, that.projectOwner) &&
                Objects.equals(projectName, that.projectName) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, projectOwner, projectName, hasWiki, createTime, updateTime);
    }

    @Override
    public String toString() {
        return "ProjectDomain{" +
                "id=" + id +
                ", projectOwner='" + projectOwner + '\'' +
                ", projectName='" + projectName + '\'' +
                ", hasWiki=" + hasWiki +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
